Electronic circuits may have many data sources, such as measurement sensors, obtaining data that need to be saved in a memory, such as a FIFO memory. FIFO memories are typically data buffers or data stacks, in which the oldest data entry is processed or read out first. A data buffer is a physical memory storage used to temporarily store data while it is being moved from one place to another. These electronic circuits also typically comprise means for managing the memory. The measurement sensors may be of different types, such as a gyroscope, an accelerometer, a magnetometer, a pressure sensor and a temperature sensor. The first three mentioned types of sensor may have multiple measurement axes. Such electronic circuits may also include an analog-to-digital (A/D) converter, arranged to convert a continuous physical quantity from any one of the data sources to a digital number that represents the quantity's amplitude. The digital signals can then be stored successively in the memory.
Data from different data sources can be sampled by using different sampling rates. For instance, in an example in which the electronic circuit comprises a gyroscopic sensor with three axes, an accelerometer with three axes, and a magnetometer with three axes, the sampling rates for all these sensors can be different from one another. We can assume a situation in which the gyroscope measurements are sampled with a sampling rate of 2000 samples per second, while the accelerometer and the magnetometer measurements are sampled at rates of 200 and 20 samples per second, respectively. In the known solutions in which data items, entries or samples from multiple data sources are saved in a FIFO memory, data samples from all the data sources are saved in the memory whenever any one of the sensor measurements is sampled. In other words, in the example in which a first data sample Gyro1 is saved from the gyroscope, the first data samples Accel1 and Magn1 respectively from the accelerometer and the magnetometer are also saved. When the second data sample Gyro2 from the gyroscope is saved, then the first data samples Accel1 and Magn1 from the accelerometer and the magnetometer are saved again in the memory. This means that, in this example, for every new saved data sample from the gyroscope, there are 10 repeated, identical data samples saved from the accelerometer and 100 repeated, identical data samples saved from the magnetometer. This solution is of course not optimal, since the FIFO memory space is limited and for this reason it is quickly filled with redundant data. Operating the FIFO memory in this manner would also increase the circuit power consumption unnecessarily.